﻿using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Autofac;
using Volo.Abp.Modularity;

namespace Abp.ConsoleModule
{
    /// <summary>
    /// 模块注入测试
    /// </summary>
    /// <param name="context"></param>
    [DependsOn(typeof(AbpAutofacModule))]
    [DependsOn(typeof(Abp.CustomConsoleModule.MyConsoleModule))]
    internal class AbpConsoleModule : AbpModule
    {
        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            //base.ConfigureServices(context);    
            Console.WriteLine("AbpConsoleModule模块...");

            // 1、注册HelloWorldService
            context.Services.AddSingleton<HelloWorldService>();

            // 2、注册AbpConsoleHostService模块
            context.Services.AddHostedService<AbpConsoleHostService>();

        }

    }
}
